from extensions import register_api
from utils.decorators import authorized
from . import api_blueprint
from .wx_app import WxAppListApi
from .message import MessageListApi
from .group import GroupListApi
from .task import TaskListApi, TaskExecuteApi, TaskApi


api = register_api(api_blueprint)

# api.decorators = [authorized]
api.add_resource(MessageListApi, '/messages')
api.add_resource(GroupListApi, '/groups')
api.add_resource(WxAppListApi, '/wx_apps')
api.add_resource(TaskApi, '/tasks/<int:task_id>')
api.add_resource(TaskListApi, '/tasks')
api.add_resource(TaskExecuteApi, '/tasks/execute')

